import axios from '@/utils/axios';
export const getInformList = (params, type) => {
    return axios.request({
        url: `/member/inform/${type}`,
        method: 'get',
        params
    });
};

export const updateSetting = (data) => {
    return axios.request({
        url: '/member/inform/',
        method: 'put',
        data
    });
};

// 分页获取当前站点邮件模板列表
export const getEmailModesPage = (params) => {
    return axios.request({
        url: '/site/emailModels/page',
        method: 'get',
        params
    });
};

// 分页获取当前站点,当前类型邮件模板列表
export const getEmailModelList = (params) => {
    return axios.request({
        url: '/site/emailModels/list',
        method: 'get',
        params
    });
};

// 新增邮件模板
export const addEmailModels = (data) => {
    return axios.request({
        url: '/site/emailModels/',
        data,
        method: 'post'
    });
};

// 编辑模板
export const updateEmailModels = (data) => {
    return axios.request({
        url: '/site/emailModels/',
        data,
        method: 'put'
    });
};

// 设置默认模板
export const setDefaultEmailModels = (data) => {
    return axios.request({
        url: '/site/emailModels/defaultState',
        data,
        method: 'put'
    });
};

// 模板详情
export const getDetailEmailModels = (siteId, modelId) => {
    return axios.request({
        url: `/site/emailModels/${siteId}/${modelId}`,
        method: 'get'
    });
};

// 删除模板
export const deleteEmailModels = (siteId, modelId) => {
    return axios.request({
        url: `/site/emailModels/${siteId}/${modelId}`,
        method: 'delete'
    });
};
// 营销通知___编辑启用停用状态
export const updatemarketingState = (data) => {
    return axios.request({
        url: '/member/inform/marketing/updateState',
        data,
        method: 'put'
    });
};

// 营销通知__新增
export const addMarketing = (data) => {
    return axios.request({
        url: '/member/inform/marketing',
        data,
        method: 'post'
    });
};

// 营销通知___删除
export const deleteMarketing = (siteId, noticeId) => {
    return axios.request({
        url: `/member/inform/marketing/${siteId}/${noticeId}`,
        method: 'delete'
    });
};

// 营销通知___编辑
export const updateMarketing = (data) => {
    return axios.request({
        url: '/member/inform/marketing',
        data,
        method: 'put'
    });
};

// 邮件模板__详情_站点id_通知id_通知类型
export const getDefaultModels = (siteId, noticeId, noticeType) => {
    return axios.request({
        url: `/site/emailModels/defaultModels/${siteId}/${noticeId}/${noticeType}`,
        method: 'get'
    });
};

// 营销通知__查询 (不分页→ 用于下拉框选择)
export const getMarketingList = (params) => {
    return axios.request({
        url: '/member/inform/marketingList',
        method: 'get',
        params
    });
};

// 邮件模板__列表_不分页
export const getEmailModelsList = (params) => {
    return axios.request({
        url: '/site/emailModels/list',
        method: 'get',
        params
    });
};
